package com.wolfeyes.system.service.impl;

import com.wolfeyes.system.domain.SysMovieCategory;
import com.wolfeyes.system.mapper.SysMovieCategoryMapper;
import com.wolfeyes.system.service.SysMovieCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @see Talk is cheap, Show me the code. -- Linus Torvalds
 * @title 电影分类信息服务层-实现类
 * @author yanyljava
 * @email yanyljava@qq.com
 * @create 2022-01-13 18:41
 */
@Service
public class SysMovieCategoryServiceImpl implements SysMovieCategoryService {

	@Autowired
	private SysMovieCategoryMapper sysMovieCategoryMapper;

	@Override
	public List<SysMovieCategory> findAll() {
		return sysMovieCategoryMapper.findAll();
	}

	@Override
	public SysMovieCategory findById(Long id) {
		return sysMovieCategoryMapper.findById(id);
	}

	@Override
	public int add(SysMovieCategory sysMovieCategory) {
		return sysMovieCategoryMapper.add(sysMovieCategory);
	}

	@Override
	public int update(SysMovieCategory sysMovieCategory) {
		return sysMovieCategoryMapper.update(sysMovieCategory);
	}

	@Override
	public int delete(Long[] ids) {
		int rows = 0;
		for (Long id : ids) {
			rows += sysMovieCategoryMapper.delete(id);
		}
		return rows;
	}
	
}

